Bulk Export via Advanced Search Profile
Introduction
The Assetic Advanced Search Profiles (a saved search) can be used as the basis for a bulk export of the search results to a csv file. The exported file will include all records returned by the search regardless of the number of records returned by the search.
This is the same functionality as provided by the 'Export All' option available for Advanced Search Profiles as outlined in the article Exporting Search Data.
Since the Advanced Search 'Export All' uses the background worker process the following REST APIs are provided:
- POST /api/v2/search/{id}/export
- Initiate the bulk export for the given search profile Id
- GET /api/v2/backgroundworker/{id}
- Check the status of the export and if complete get the document Id
- GET /api/v2/document/{id}/file
- Get the export file using the document Id
Bulk Export Steps
1. Initiate Bulk Export
Assetic REST API endpoint POST /api/v2/search/{id}/export is used to create a new export task. The response is the ID of the task which should be recorded for use in the next step.
2. Check Background Worker Status
Since the background worker process queues jobs the export may not be created immediately.
Using the the Assetic REST API endpoint GET /api/v2/backgroundworker/{id} this taskid can be used to check the status of the export task.
If the task is complete, the GET /api/v2/backgroundworker/{id} response also returns the document GUID of the csv file.
3. Download the Export File
The Assetic REST API endpoint GET /api/v2/document/{id}/file is used to get the csv document. Refer to the article Retrieving Files for further information about this REST API endpoint.